﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZX.SYS.Library;
using ZX.DBModule;
using ZX.Common;
namespace ZX.SYS.Bussiness.Message
{

    public partial class BV_HistoryMessagePool : BLL.Extend.BaseBussnies<V_HistoryMessagePool>
    {
        public BV_HistoryMessagePool() { this.entity = new V_HistoryMessagePool(); }


          /// <summary>
          /// 获取指定用户的系统信息
          /// </summary>
          /// <param name="ReceiverID">接收者</param>
          /// <param name="SendState">状态 0:未查看 1:已查看 </param>
          /// <returns></returns>
        public IList<V_HistoryMessagePool> GetReceiverSysMessages(Guid? ReceiverID )
        {
            try
            {
                string s = " ReceiverID='" + ReceiverID.ToString() + "'";
                return this.GetEntityListByCondition<V_HistoryMessagePool>(s);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public bool HistoryMsgExists(Guid MsgID)
        {
            bool isExists = false;
            try
            {

                string s = " MsgID='" + MsgID.ToString() + "'";
                BLL.Extend.BaseBussnies bll = new BLL.Extend.BaseBussnies();
                bll.entity = new DatHistoryMessageQueue();
                DatHistoryMessageQueue m = bll.GetEntityByCondition<DatHistoryMessageQueue>(s);
                if (m != null) { isExists = true; }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return isExists;
        }
    }
}
